;---------------------------------------------------------------------------
;Knife Throw
[Statedef 1000]
type    = S
movetype= I
physics = S
poweradd = 40
velset = 0,0
anim = 1000+(3*(Cond(Var(44),NumExplod(90000210) != 0,NumExplod(90000240) != 0) && !Var(53)))
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1000, 1]
type = VarSet
trigger1 = !Time
v = 11
value = 0

[State 1000, 2]
type = VarSet
trigger1 = !Var(59) && Time
var(11) = Cond(Cond(Facing = 1, NumExplod(90000006), NumExplod(90000004)),1,Cond(Cond(Facing = 1, NumExplod(90000004), NumExplod(90000006)),2,0))

[State 1000, 3]
type = VarSet
trigger1 = Var(59) && Time
var(11) = ifelse(random <= 101, 0, ifelse(random <= 299, 2, 1))

[State 1000, 3]
type = Helper
trigger1 = AnimElem = 3
name = "Knife"
ID = 1000
stateno = 1001
pos = ceil(41*const(size.xscale)),ceil(-38*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1000, 4]
type = VarAdd
trigger1 = AnimElem = 3
var(37) = 1

[State 1000, 5]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1000,0
channel = 0

[State 1000, 6]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8030
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1000, 7]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8030
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1000, 8]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1000, 9]
type = StateTypeSet
trigger1 = Time = 12
movetype = A

[State 1000, 10]
type = StateTypeSet
trigger1 = Time = 14
movetype = I

[State 1000, 11]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;Knife
[Statedef 1001]
type    = S
movetype= A
physics = N
ctrl = 0
velset = (4+(IfElse(parent,Var(11) = 1,1,IfElse(parent,Var(11) = 2,-1,0))))*const(size.xscale),0
anim = 1001
sprpriority = 3

[State 1001, 4]
type = HitBy
trigger1 = 1
value = SCA,AP
time = -1

[State 1001, 5]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 1002
time = -1

[State 1001, 5]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1

[State 1001, 6]
type = HitDef
trigger1 = root,var(5) < 6 && !Time
attr = S, SP
damage = ceil(60*root,Fvar(20)),15
animtype = Hard
guardflag = MAF
hitflag = MAF
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = F5, 2
guardsound = F6, 0
ground.type = Low
ground.slidetime = 19
ground.hittime  = 22
ground.velocity = -5*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.velocity = -2.4*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
;fall = 1
;fall.recover = 0
id = 1001
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 25, 13

[State 1001, 7]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1001, 8]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1001, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1001, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1001, 11]
type = VarSet
trigger1 = NumTarget && MoveContact
var(0) = 1
ignorehitpause = 1

[State 1001, 12]
type = ChangeState
trigger1 = MoveContact
value = 1002

[State 1001, 13]
type = ChangeState
trigger1 = FrontEdgeDist < -40
value = 1003
;-------------------------------------------------------------------------
;Knife Explod
[Statedef 1002]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 6001

[State 1002, 1]
type = PowerAdd
trigger1 = !Time
value = 50-25*(NumTarget && MoveGuarded)
ignorehitpause = 1

[State 1002, 2]
type = ChangeAnim
trigger1 = Anim = 6001 && !AnimTime
value = 1

[State 1002, 3]
type = ParentVarAdd
trigger1 = !Time
var(37) = -1

[State 1002, 4]
type = DestroySelf
triggerall = parent,Var(37) = 0
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;-------------------------------------------------------------------------
;Knife Explod
[Statedef 1003]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 1

[State 1002, 3]
type = ParentVarAdd
trigger1 = !Time
var(37) = -1

[State 1002, 4]
type = DestroySelf
triggerall = parent,Var(37) = 0
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;Boomerang Throw (EX Knife Toss)
[Statedef 1010]
type    = S
movetype= I
physics = S
poweradd = -500
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1010, 1]
type = Helper
trigger1 = AnimElem = 3
name = "Boomerang"
ID = 1000
stateno = 1011
pos = ceil(41*const(size.xscale)),ceil(-33*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1010, 2]
type = VarAdd
trigger1 = AnimElem = 3
var(37) = 1

[State 1010, 3]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1010, 4]
type = PlaySnd
trigger1 = !Time
value = F799,0
ignorehitpause = 1

[State 1010, 5]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8033
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1010, 6]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8033
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1010, 7]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1000, 8]
type = StateTypeSet
trigger1 = (Anim = 1000 && Time = 12) || (Anim = 1003 && Time = 21)
movetype = A

[State 1000, 9]
type = StateTypeSet
trigger1 = (Anim = 1000 &&  Time = 14) || (Anim = 1003 && Time = 23)
movetype = I

[State 1010, 10]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Boomerang
[Statedef 1011]
type    = A
movetype= A
physics = N
velset = 4*const(size.xscale),0
anim = 1011
ctrl = 0
sprpriority = 2

[State 1011, 1]
type = NotHitBy
trigger1 = 1
value = ,AA,NP,SP,AT
time = -1

[State 1011, 2]
type = HitOverride
trigger1 = 1
attr = SCA,HP
slot = 0
stateno = 1002
time = -1

[State 1011, 3]
type = PlayerPush
trigger1 = 1
value = 0
ignorehitpause = 1

[State 1011, 4]
type = HitDef
trigger1 = parent,Var(5) < 6 && Vel X > 0
attr = S, SP
damage = ceil(40*root,Fvar(20)),10
animtype = Hard
guardflag = MA
getpower = 0,0
givepower = 25, 13
pausetime = 1,1
hitflag = MAF
priority = 4, Hit
pausetime = 0,0
sparkno = S6000
hitsound = F5, 2
guardsound = F6, 0
ground.type = Low
ground.slidetime = 22
ground.hittime  = 23
ground.velocity = -8*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.velocity = -5.4*const(size.xscale),-3.5*const(size.yscale)
air.hittime = 100
air.cornerpush.veloff = 0
fall.recover = 0
yaccel = .35*const(size.yscale)
id = 1011
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
persistent = 0

[State 1011, 5]
type = HitDef
triggerall = (!HitCount && parent,Var(5) < 6) || HitCount
trigger1 = Vel X < 0
attr = S, SP
damage = ceil(40*root,Fvar(20)),10
animtype = Hard
guardflag = MAF
getpower = 0,0
givepower = 25, 13
pausetime = 1,1
hitflag = MAF
priority = 4, Hit
pausetime = 0,0
sparkno = S6000
hitsound = F5, 2
guardsound = F6, 0
ground.type = Low
ground.slidetime = 20
ground.hittime  = 22
ground.velocity = 8*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.velocity = 5.4*const(size.xscale),-3.5*const(size.yscale)
air.hittime = 100
air.cornerpush.veloff = 0
yaccel = .35*const(size.yscale)
id = 1011
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
persistent = 0

[State 1011, 6]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && HitPauseTime = 1 && !Var(1) && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1

[State 1011, 7]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A && !HitCount
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1011, 7]
type = VarAdd
trigger1 = NumTarget && MoveHit && !Var(1)
var(1) = 1

[State 1011, 7]
type = VarSet
trigger1 = !NumTarget
var(1) = 0

[State 1011, 8]
type = PlaySnd
trigger1 = !(GameTime % 12)
value = S1010,0

[State 1011, 9]
type = VelAdd
trigger1 = Time > 50 && Time < 67
x = -.5*const(size.xscale)

[State 1001, 11]
type = VarSet
trigger1 = NumTarget && MoveContact
var(0) = 1
ignorehitpause = 1

[State 1011, 12]
type = ChangeState
trigger1 = BackEdgeBodyDist < -65
trigger2 = Vel X < 0 && ((ParentDist X = [-30*const(size.xscale),30*const(size.xscale)]) && (ParentDist Y = [0,39*const(size.yscale)]))
value = 1012
;-------------------------------------------------------------------------
;Knife Explod
[Statedef 1012]
type    = S
movetype= A
physics = N
ctrl = 0
velset = 0,0
anim = 1

[State 1012, 1]
type = ParentVarAdd
trigger1 = !Time
var(37) = -1

[State 1012, 2]
type = DestroySelf
trigger1 = !NumTarget
trigger2 = NumTarget
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;Backflip
[Statedef 1050]
type    = S
movetype= A
physics = S
poweradd = 60*(1-var(53))
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1050, 1]
type = VarSet
trigger1 = !Var(59) && !Time
var(11) = NumExplod(90000230) != 0

[State 1050, 2]
type = VarSet
trigger1 = Var(59) && !Time
var(11) = PrevStateNo = [400,499]

[State 1050, 3]
type = NotHitBy
trigger1 = Var(11) && !Var(53)
value = SCA,AA,AP
time = 1

[State 1050, 4]
type = NotHitBy
trigger1 = !Var(11) && !Time
value = SCA,AA,AP
time = 3

[State 1050, 5]
type = NotHitBy
trigger1 = !Var(11) && AnimElem = 2
value = SCA,AT
time = 2

[State 1050, 6]
type = PosAdd
trigger1 = !Var(11) && AnimElem = 2
x = 10*const(size.xscale)

[State 1050, 7]
type = PlaySnd
trigger1 = AnimElem = 2
value = S1050,0

[State 1050, 8]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8031
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1050, 9]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8031
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1050, 10]
type = AssertSpecial
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 1050, 11]
type = ChangeState
trigger1 = !AnimTime
value = 1051
;---------------------------------------------------------------------------
;Backflip (In Air)
[Statedef 1051]
type    = A
movetype= A
physics = N
velset = (-1-1*(Var(11) && !Var(53)))*const(size.xscale),(-8.1+1.3*(Var(11) && !Var(53)))*const(size.yscale)
anim = 1051
ctrl = 0
sprpriority = 2

[State 1051, 1]
type = HitDef
trigger1 = Var(5) < 6 && AnimElem = 1 && !Movecontact
attr = S,SA
hitflag = MAF
guardflag = MA
animtype = Hard
getpower = 120*(1-var(53)), 60*(1-var(53))
givepower = 60, 30
priority = 4,Hit
damage = ceil((100-20*var(11))*Fvar(20)),25-5*var(11)
pausetime = 12,12
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-45*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 25
guard.slidetime = 25
ground.hittime = 25
guard.hittime = 25
ground.velocity = -1.3*const(size.xscale), -8.4+1*var(11)*const(size.yscale)
guard.velocity = -4.8
air.type = High
air.hittime = 100
air.velocity = -2.6*const(size.xscale), -5.9+1*var(11)*const(size.yscale)
fall = 1
fall.recover = 0
yaccel = .35*const(size.yscale)
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1051, 2]
type = HitDef
trigger1 = Var(5) < 6 && AnimElem = 2 && !Movecontact
attr = A,SA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
getpower = 0
damage = ceil((80-20*(Var(11) && !Var(53)))*Fvar(20)),20-15*(Var(11) && !Var(53))
getpower = 80*(1-var(53)),40*(1-var(53))
pausetime = 10,10
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-53*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 20
guard.slidetime = 20
ground.hittime = 20
guard.hittime = 20
ground.velocity = -2.2*const(size.xscale), -6.4+1*(Var(11) && !Var(53))*const(size.yscale)
guard.velocity = -4.8
air.type = High
air.hittime = 100
air.velocity = -2.5*const(size.xscale), -4.7+1*(Var(11) && !Var(53))*const(size.yscale)
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1051
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1051, 3]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1051, 4]
type = StateTypeSet
trigger1 = AnimElem = 3
movetype = I

[State 1051, 5]
type = Explod
trigger1 = Time = 2
anim = 1053
ID = 1050
pos = ceil(35*const(size.xscale)),ceil(-35*const(size.yscale))
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 3
ownpal = 1

[State 1051, 6]
type = VelAdd
trigger1 = 1
y = .35*const(size.yscale)

[State 1051, 7]
type = PlaySnd
trigger1 = !Time
value = F0,4

[State 1051, 8]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -5
value = 1052
;---------------------------------------------------------------------------
;Backflip (Land)
[Statedef 1052]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 1052
ctrl = 0
sprpriority = 2

[State 1052, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 1052, 2]
type = PlaySnd
trigger1 = !Time
value = S40,1

[State 1052, 3]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1052, 4]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;EX Backflip
[Statedef 1060]
type    = S
movetype= A
physics = S
poweradd = -500
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1060, 1]
type = NotHitBy
trigger1 = !Time 
value = SCA,AA,AP,AT
time = 7

[State 1060, 2]
type = PosAdd
trigger1 = AnimElem = 2
x = 10*const(size.xscale)

[State 1060, 3]
type = PlaySnd
trigger1 = AnimElem = 2
value = S1050,0

[State 1060, 4]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1060, 5]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1060, 6]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8034
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1060, 7]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8034
ID = 8030
pos = 239,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1060, 8]
type = AssertSpecial
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 1060, 9]
type = ChangeState
trigger1 = !AnimTime
value = 1061
;---------------------------------------------------------------------------
;EX Backflip (In Air)
[Statedef 1061]
type    = A
movetype= A
physics = N
velset = -1.2*const(size.xscale),-8.1*const(size.yscale)
anim = 1051
ctrl = 0
sprpriority = 2

[State 1061, 1]
type = HitDef
trigger1 = Var(5) < 6 && AnimElem = 1 && !movecontact
attr = S,SA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
getpower = 0
givepower = 30, 15
damage = ceil(90*Fvar(20)),23
pausetime = 12,12
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-13*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 20
guard.slidetime = 20
ground.hittime = 20
guard.hittime = 20
ground.velocity = -1.3*const(size.xscale), -10.6*const(size.yscale)
guard.velocity = -4.8*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -2.6*const(size.xscale), -7.3*const(size.yscale)
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1061, 2]
type = HitDef
trigger1 = Var(5) < 6 && AnimElem = 2 && !movecontact
attr = A,SA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
getpower = 0
givepower = 30, 15
damage = ceil(80*Fvar(20)),20
pausetime = 10,10
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-37*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 20
guard.slidetime = 20
ground.hittime = 20
guard.hittime = 20
ground.velocity = -2.2*const(size.xscale), -4.4*const(size.yscale)
guard.velocity = -4.8*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -2.5*const(size.xscale), -3.7*const(size.yscale)
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1051
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1061, 3]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1061, 4]
type = StateTypeSet
trigger1 = AnimElem = 3
movetype = I

[State 1061, 5]
type = Explod
trigger1 = Time = 2
anim = 1053
ID = 1050
pos = ceil(35*const(size.xscale)),ceil(-35*const(size.yscale))
postype = p1
facing = 1
vfacing = 1
bindtime = -1
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = 3
ownpal = 1

[State 1061, 6]
type = VelAdd
trigger1 = 1
y = .35*const(size.yscale)

[State 1061, 7]
type = Helper
trigger1 = AnimElem = 3 
name = "Axe"
ID = 1060
stateno = 1063
pos = ceil(43*const(size.xscale)),ceil(-51*const(size.yscale))
postype = p1    ;p2,front,back,left,right
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1061, 8]
type = AssertSpecial
trigger1 = Time <= 2 && (GameTime % 2) = 0
flag = invisible

[State 1061, 9]
type = PlaySnd
trigger1 = !Time
value = F0,4

[State 1061, 10]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1061, 11]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y >= -5
value = 1062
;---------------------------------------------------------------------------
;EX Backflip (Land)
[Statedef 1062]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 1052
ctrl = 0
sprpriority = 2

[State 1062, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 1062, 2]
type = PlaySnd
trigger1 = !Time
value = S40,1

[State 1062, 3]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1062, 4]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1062, 5]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Axe
[Statedef 1063]
type    = A
movetype= A
physics = N
velset = 4.0*const(size.xscale),-5.6*const(size.yscale) ;5.86,-3.86
anim = 1063
ctrl = 0
sprpriority = 2

[State 1063, 1]
type = HitDef
trigger1 = !Time
attr = A,SP
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4,Hit
getpower = 0
givepower = 30, 15
damage = ceil(55*root,Fvar(20)),14
pausetime = 8,8
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-13*const(size.xscale))
hitsound = F5,2
guardsound = F6,0
ground.type = High
ground.slidetime = 11
ground.hittime = 27
guard.hittime = 20
ground.velocity = -5.3*const(size.xscale), -4.4*const(size.yscale)
air.type = High
air.hittime = 100
air.velocity = -6.6*const(size.xscale), -3.9*const(size.yscale)
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1063, 2]
type = VelAdd
trigger1 = 1
y = .3*const(size.yscale)

[State 1063, 4]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1

[State 1063, 5]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
slot = 0
stateno = 1002
time = -1

[State 1063, 6]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && root,Fvar(21) > .3
trigger1 = !((root,StateNo = [1060, 1062]) && root,NumTarget)
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1063, 7]
type = ParentVarAdd
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1063, 8]
type = PlaySnd
trigger1 = !(GameTime % 15)
value = S1060,0
ignorehitpause = 1

[State 1063, 9]
type = ChangeState
trigger1 = Pos Y >= 100
value = 1003
;-------------------------------------------------------------------------
;Whip Swing
[Statedef 1100]
type    = S
movetype= I
physics = S
velset = 0,0
ctrl = 0
poweradd = 80*(1-var(53))
anim = 1100+(1*(Cond(Var(44),NumExplod(90000210) != 0,NumExplod(90000240) != 0)))
facep2 = 1

[State 1100, 1]
type = VarSet
trigger1 = !Var(59) && !Time && !Var(53)
var(10) = Cond(Var(44),NumExplod(90000210) != 0,NumExplod(90000240) != 0)

[State 1100, 2]
type = HitDef
trigger1 = var(5) < 6 && Anim = 1100 && AnimElem = 6
attr = S,SA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
pausetime = 12,12
getpower = 120,60
givepower = 60, 30
damage = ceil(80*Fvar(20)),20
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-41*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 17
guard.slidetime = 17
ground.hittime = 18
guard.hittime = 18
ground.velocity = -6.4*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -2.6*const(size.xscale), -1.3*const(size.yscale)
yaccel = .35*const(size.yscale)
id = 1100
chainID = -1
nochainID = -1
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1100, 3]
type = HitDef
trigger1 = var(5) < 6 && Anim = 1101 && AnimElem = 6
attr = S,SA
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4,Hit
pausetime = 12,12
getpower = 120,60
givepower = 60, 30
damage = ceil(90*Fvar(20)),23
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-31*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 17
guard.slidetime = 17
ground.hittime = 18
guard.hittime = 18
ground.velocity = -6.4*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -2.6*const(size.xscale), -1.3*const(size.yscale)
yaccel = .35*const(size.yscale)
id = 1100
chainID = -1
nochainID = -1
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1100, 4]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1101, 5]
type = StateTypeSet
trigger1 = AnimElem = 5
movetype = A 

[State 1101, 6]
type = StateTypeSet
trigger1 = AnimElem = 8
movetype = I

[State 1101, 7]
type = Helper
trigger1 = AnimElem = 6
name = "Whip Helper"
ID = 1102
stateno = 1102
pos = ceil(120*const(size.xscale)),ceil(-42+(10*(Anim = 1101))*const(size.yscale))
postype = p1
facing = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1100, 8]
type = PlaySnd
trigger1 = AnimElem = 2
value = S1100,0

[State 1100, 9]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8032
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1100, 10]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8032
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1100, 11]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1100, 12]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;Whip Helper
[Statedef 1102]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 1102
sprpriority = 3

[State 1102, 1]
type = BindToParent
trigger1 = !Time
time = 1
pos = 120*const(size.xscale),(-42+(10*(root,Anim = 1101)))*const(size.yscale)
ignorehitpause = 1

[State 1102, 2]
type = HitBy
trigger1 = 1
value = SCA,AP
time = 1

[State 1102, 3]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 1103
time = 1 

[State 1102, 4]
type = ScreenBound
trigger1 = 1
value = 0

[State 1102, 5]
type = PlayerPush
trigger1 = 1
value = 0

[State 1102, 6]
type = DestroySelf
trigger1 = (root,StateNo != 1100 && root,StateNo != 1110) || ((root,StateNo = 1100 || root,StateNo = 1110) && root,AnimElem = 7)
;-------------------------------------------------------------------------
;Whip Helper
[Statedef 1103]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 1102
sprpriority = 3

[State 1103, 1]
type = PowerAdd
trigger1 = !Time
value = 100*GetHitVar(hitcount)

[State 1102, 2]
type = BindToParent
trigger1 = !Time
time = 1
pos = 120*const(size.xscale),(-42+(10*(root,Anim = 1101)))*const(size.yscale)
ignorehitpause = 1

[State 1102, 3]
type = HitBy
trigger1 = 1
value = SCA,AP
time = 1

[State 1102, 4]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 1103
time = 1 

[State 1102, 5]
type = ScreenBound
trigger1 = 1
value = 0

[State 1102, 6]
type = PlayerPush
trigger1 = 1
value = 0

[State 1102, 7]
type = NotHitBy
trigger1 = (root,StateNo != 1100 || root,StateNo != 1106 || root,StateNo != 1110) || ((root,StateNo = 1100 || root,StateNo = 1110) && root,AnimElem = 7) || (root,StateNo = 1106 && root,AnimElem = 5)
value = SCA
time = 1

[State 1102, 8]
type = DestroySelf
trigger1 = Time
;-------------------------------------------------------------------------
;Whip Swing
[Statedef 1105]
type    = A
movetype= A
physics = N
ctrl = 0
poweradd = 80*(1-var(53))
anim = 1105+(3*(Cond(Var(44) && !Var(59),NumExplod(90000210) != 0,NumExplod(90000240) != 0)))

[State 1100, 1]
type = VarSet
trigger1 = !Var(59) && !Time
var(10) = Cond(Var(44) && !Var(59), (NumExplod(90000210) != 0), (NumExplod(90000240) != 0))

[State 1105, 2]
type = VelAdd
trigger1 = 1
y = .35*const(size.yscale)

[State 1105, 3]
type = HitDef
trigger1 = var(5) < 6 && AnimElem = 6 && Anim = 1105
attr = A,SA
hitflag = MAF
guardflag = HA
animtype = Hard
priority = 4,Hit
pausetime = 12,12
getpower = 120,60
givepower = 60, 30
damage = ceil(105*Fvar(20)),27
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-41*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 17
guard.slidetime = 3
ground.hittime = 18
guard.hittime = 2
ground.velocity = -6.4*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -2.6*const(size.xscale), -1.3*const(size.yscale)
yaccel = .35*const(size.yscale)
id = 1100
chainID = -1
nochainID = -1
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1105, 4]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1105, 5]
type = StateTypeSet
trigger1 = AnimElem = 7 && Anim = 1105
trigger2 = AnimElem = 1 && Anim = 1107
movetype = I

[State 1105, 6]
type = Helper
trigger1 = AnimElem = 6 && Anim = 1105
name = "Whip Helper"
ID = 1102
stateno = 1107
pos = ceil(120*const(size.xscale)),ceil(-47*const(size.yscale))
postype = p1
facing = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1105, 7]
type = PlaySnd
trigger1 = AnimElem = 2 && Anim = 1105
value = S1100,0

[State 1105, 8]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8032
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1105, 9]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8032
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1105, 10]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 1106
;---------------------------------------------------------------------------
;Whip Swing (Land)
[Statedef 1106]
type    = S
movetype= I
physics = N
velset = 0,0
anim = 1106+(3*(Var(10)))
ctrl = 0
sprpriority = 2

[State 1106, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 1106, 2]
type = PlaySnd
trigger1 = !Time
value = S40,1

[State 1106, 3]
type = HitDef
trigger1 = var(5) < 6 && Var(10) && AnimElem = 4
attr = S,SA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
pausetime = 12,12
getpower = 120,60
givepower = 60, 30
damage = ceil(80*Fvar(20)),20
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-41*const(size.xscale))
hitsound = F5,3
guardsound = F6,0
ground.type = High
ground.slidetime = 17
guard.slidetime = 17
ground.hittime = 18
guard.hittime = 18
ground.velocity = -6.4*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -2.6*const(size.xscale), -1.3*const(size.yscale)
yaccel = .35*const(size.yscale)
id = 1100
chainID = -1
nochainID = -1
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1106, 4]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1106, 5]
type = StateTypeSet
trigger1 = AnimElem = 1 && Var(10)
movetype = A 

[State 1106, 6]
type = StateTypeSet
trigger1 = AnimElem = 5 && Var(10)
movetype = I

[State 1106, 7]
type = Helper
trigger1 = AnimElem = 4 && Var(10)
name = "Whip Helper"
ID = 1102
stateno = 1102
pos = ceil(120*const(size.xscale)),ceil(-40*const(size.yscale))
postype = p1
facing = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1106, 8]
type = PlaySnd
trigger1 = AnimElem = 1 && Var(10)
value = S1100,0

[State 1106, 9]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1106, 10]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;Whip Helper
[Statedef 1107]
type    = S
movetype= I
physics = S
ctrl = 0
anim = 1102
sprpriority = 3

[State 1106, 1]
type = BindToParent
trigger1 = 1
time = 1
pos = 120*const(size.xscale),-47*const(size.yscale)
ignorehitpause = 1

[State 1106, 2]
type = HitBy
trigger1 = 1
value = SCA,AP
time = 1

[State 1106, 3]
type = HitOverride
trigger1 = 1
attr = SCA,AP
slot = 0
stateno = 1102
time = 1 

[State 1106, 4]
type = ScreenBound
trigger1 = 1
value = 0

[State 1106, 5]
type = PlayerPush
trigger1 = 1
value = 0

[State 1106, 6]
type = DestroySelf
trigger1 = (root,StateNo != 1105 && root,StateNo != 1115) || ((root,StateNo = 1100 || root,StateNo = 1115) && root,AnimElem = 7)
;-------------------------------------------------------------------------
;EX Whip Swing
[Statedef 1110]
type    = S
movetype= A
physics = S
velset = 0,0
ctrl = 0
poweradd = -500
anim = 1110
facep2 = 1

[State 1110, 1]
type = HitDef
triggerall = (!HitCount && Var(5) < 6) || HitCount
trigger1 = AnimElem = 6 || AnimElem = 8 || AnimElem = 10 || AnimElem = 12 || AnimElem = 14 || AnimElem = 16
attr = S,SA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
getpower = 0
givepower = 60, 30
pausetime = 4,8
damage = ceil(20*Fvar(20)),5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-41*const(size.xscale))
hitsound = F5,4
guardsound = F6,0
ground.type = High
ground.slidetime = 17
guard.slidetime = 17
ground.hittime = 18
guard.hittime = 18
ground.velocity = -5.4*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = High
air.hittime = 100
air.velocity = -5*const(size.xscale), -2.1*const(size.yscale)
yaccel = .35*const(size.yscale)
fall = 1
air.fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1110, 2]
type = Helper
trigger1 = AnimElem = 6
name = "Whip Helper"
ID = 1102
stateno = 1102
pos = 0,0
postype = p1
facing = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1110, 3]
type = VarAdd
trigger1 = NumTarget && MoveHit && HitCount = 1 && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1110, 4]
type = TargetState
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 4
value = 5400
ignorehitpause = 1

[State 1110, 5]
type = Null
triggerall = NumTarget
trigger1 = target,BackEdgeBodyDist <= 0 && target,HitShakeOver && Vel X = 0 && Time
x = -5.4*const(size.xscale)
ignorehitpause = 1
persistent = 0

[State 1110, 6]
type = PlaySnd
trigger1 = AnimElem = 2
value = S1100,0

[State 1110, 7]
type = PlaySnd
trigger1 = AnimElemTime(2) = 2
value = S1110,0

[State 1110, 8]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1110, 9]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1110, 10]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8035
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1110, 11]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8035
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1110, 12]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1110, 13]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;-------------------------------------------------------------------------
;EX Whip Swing
[Statedef 1115]
type    = A
movetype= A
physics = N
ctrl = 0
poweradd = -500
anim = 1115
facep2 = 1

[State 1115, 1]
type = VarSet
trigger1 = !Time
fvar(10) = Vel X

[State 1115, 2]
type = VarSet
trigger1 = !Time
fvar(11) = Vel Y

[State 1115, 3]
type = VelSet
trigger1 = Time = 1
x = (-.2*(-1*(fvar(10) > 0) + 1*(fvar(10) < 0)))*const(size.xscale)
y = (-.2*(-1*(fvar(11) > 0) + 1*(fvar(11) < 0)))*const(size.yscale)

[State 1115, 4]
type = VarSet
trigger1 = !Time
var(10) = 0

[State 1115, 5]
type = HitDef
triggerall = (!HitCount && Var(5) < 6) || HitCount
trigger1 = AnimElem = 6 || AnimElem = 8 || AnimElem = 10 || AnimElem = 12 || AnimElem = 14 || AnimElem = 16
attr = A,SA
hitflag = MAF
guardflag = MA
animtype = Hard
priority = 4,Hit
getpower = 0
givepower = 60, 30
pausetime = 4,8
damage = ceil(20*Fvar(20)),5
sparkno = S6001
guard.sparkno = -1
sparkxy = -9,ceil(-41*const(size.xscale))
hitsound = F5,4
guardsound = F6,0
ground.type = High
ground.slidetime = 17
guard.slidetime = 17
ground.hittime = 18
guard.hittime = 18
ground.velocity = -5.4*const(size.xscale), -2.1*const(size.yscale)
air.type = High
air.hittime = 100
air.velocity = -5.4*const(size.xscale), -2.1*const(size.yscale)
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1050
chainID = -1
nochainID = -1
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1115, 6]
type = Helper
trigger1 = AnimElem = 6
name = "Whip Helper"
ID = 1102
stateno = 1107
pos = 0,0
postype = p1
facing = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1115, 7]
type = VarAdd
trigger1 = NumTarget && MoveHit && HitCount = 1 && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1115, 8]
type = TargetState
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 4
value = 5400
ignorehitpause = 1

[State 1115, 9]
type = PlaySnd
trigger1 = AnimElem = 2
value = S1100,0

[State 1100, 10]
type = PlaySnd
trigger1 = AnimElemTime(2) = 2
value = S1110,0

[State 1115, 11]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1115, 12]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1115, 13]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8035
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1115, 14]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8035
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1115, 15]
type = RemoveExplod
trigger1 = !AnimTime
id = 8030

[State 1115, 16]
type = Null
trigger1 = Pos Y >= 0 && Vel Y != 0 && AnimElemTime(21) <= 0
x = 0
y = 0

[State 1115, 17]
type = VelAdd
trigger1 = Time > 47
y = .35*const(size.yscale)

[State 1115, 18]
type = ChangeState
trigger1 = Time >= 47 && Vel Y > 0 && Pos Y > -Vel Y
value = 1106